home *** CD-ROM | disk | FTP | other *** search
/ Aminet 8 / Aminet 8 (1995)(GTI - Schatztruhe)[!][Oct 1995].iso / Aminet / util / batch / BGUIMenu.lha / BGUIMenu-Install < prev    next >
Text File  |  1995-09-03  |  5KB  |  189 lines

  1. ;
  2. ; Installer Script for BGUIMenu V1.x
  3. ;
  4.  
  5. ;
  6. ; Procedures
  7. ;
  8.  
  9. (procedure InstallLib
  10.     (working ("Copying %s" libname))
  11.     (copylib
  12.         (prompt ("Do you want to install the \"%s\"?" libname))
  13.         (help @copylib-help)
  14.         (source (tackon "libs/" libname))
  15.         (dest "libs:")
  16.         (confirm)
  17.     )
  18. )
  19.  
  20. (procedure AskDocDir
  21.     (set docdir
  22.         (askdir
  23.             (prompt "Where do you want to install the documentation? ")
  24.             (help @askdir-help)
  25.             (default "Help:English")
  26.         )
  27.     )
  28. )
  29.  
  30. (procedure Install
  31.     (message "You are now about to install the BGUIMenu program. "
  32.              "You will be first asked for all the different files "
  33.              "you can install and then this script will begin to "
  34.              "install the files."
  35.     )
  36.  
  37.     (set maindest
  38.         (askdir
  39.             (prompt "Where do you want to install BGUIMenu program? "
  40.                     "No drawer will be created in this directory. ")
  41.             (help @askdir-help)
  42.             (default "Sys:Utilities")
  43.         )
  44.     )
  45.     (set @default-dest maindest)
  46.  
  47.     (set maindrawer ("%s drawer? " maindest))
  48.     (set fileflag
  49.         (askoptions
  50.             (prompt "Which files do you want to install in the "
  51.                     maindrawer)
  52.             (help @askoptions-help)
  53.             (choices
  54.                 "BGUIMenu"
  55.                 "BGUIMenu.guide"
  56.             )
  57.         )
  58.     )
  59.  
  60.     (set examples
  61.         (askbool
  62.             (prompt "Do you want to install the extra examples? ")
  63.             (help "The example files are made to show you how to "
  64.                   "work with BGUIMenu. If you select yes, you can "
  65.                   "select between all the example script delivered "
  66.                   "with this Version of BGUIMenu. The files will be "
  67.                   "copied to your \"s:\" directory.")
  68.         )
  69.     )
  70.  
  71.     (set exampleflag 0)
  72.     (if examples
  73.         (
  74.             (set exampleflag
  75.                 (askoptions
  76.                     (prompt "Which Example Scripts do you want to install in "
  77.                             "your \"s:\" drawer? ")
  78.                     (help @askoptions-help)
  79.                     (choices
  80.                         "Example1"
  81.                         "Example2"
  82.                         "Unpack"
  83.                     )
  84.                 )
  85.             )
  86.         )
  87.     )
  88.  
  89.     (set lib
  90.        (askbool
  91.            (prompt "Do you wish to install the bgui.library delivered with "
  92.                    "this version of BGUIMenu ? Press Help for more info.")
  93.            (help   "You will need this library if you want to use BGUIMenu "
  94.                    "at all. I included the newest Version I got. "
  95.                    "If you already have installed bgui.library you might "
  96.                    "want to skip this option.")
  97.         )
  98.     )
  99.  
  100. ; Begin to copy the files
  101.  
  102.  
  103.     (if fileflag
  104.         (
  105.             (if (in fileflag 0)
  106.                 (    
  107.                     (copyfiles
  108.                         (source (tackon sdir "BGUIMenu"))
  109.                         (dest maindest)
  110.                         (infos)
  111.                    )
  112.                 )
  113.             )
  114.             
  115.             (if (in fileflag 1)
  116.                 (
  117.                     (AskDocDir)
  118.                     (copyfiles
  119.                         (source (tackon sdir "BGUIMenu.guide"))
  120.                         (dest docdir)
  121.                         (infos)
  122.                     )
  123.                 )
  124.             )
  125.         )
  126.     )
  127.     (complete 50)
  128.  
  129.     (if examples
  130.         (
  131.             (working "Copying Example files")
  132.             (if (in examples 0)
  133.                 (
  134.                     (copyfiles
  135.                         (source (tackon sdir "Examples/"))
  136.                         (dest "s:")
  137.                         (pattern "Example1#?")
  138.                     )
  139.                 )
  140.             )
  141.             (if (in examples 1)
  142.                 (
  143.                     (copyfiles
  144.                         (source (tackon sdir "Examples/"))
  145.                         (dest "S:")
  146.                         (pattern "Example2#?")
  147.                     )
  148.                     (copyfiles
  149.                         (source (tackon sdir "Examples/"))
  150.                         (dest "S:")
  151.                         (pattern "Script#?")
  152.                     )
  153.                 )
  154.             )
  155.             (if (in examples 2)
  156.                 (
  157.                     (copyfiles
  158.                         (source (tackon sdir "Examples/"))
  159.                         (dest "S:")
  160.                         (pattern "Unpack#?")
  161.                     )
  162.                 )
  163.             )
  164.         )
  165.     )
  166.     (complete 75)
  167.     
  168.     (if lib
  169.         (
  170.             (set libname "bgui.library")
  171.             (InstallLib)
  172.         )
  173.     )
  174.     (complete 100)
  175. )
  176.         
  177. ; Main "program" :-)
  178.  
  179. (complete 0)
  180. (set sdir (pathonly @icon))
  181. (if (< (/ (getversion) 65536) 37)
  182.     (abort "You must have Kickstart 2.0 or greater to use this installation"
  183.            " utility and to run \"BGUIMenu\".")
  184. )
  185.  
  186. (welcome)
  187.  
  188. (Install)
  189.